home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Amiga
/
World of Amiga.iso
/
archive
/
assembly
/
modripper.lha
/
noiseripper.S
< prev
Wrap
Text File
|
1990-09-13
|
22KB
|
1,323 lines
section l,code_p
;--- NOISERIPPER V1.15 WRITTEN BY ALLEYCAT OF THALYSIS
;
;--- STARTUP-CODE / NOW IT CAN BE LOADED FROM CLI AND WB
MOVEM.L D0/A0,-(SP)
CLR.L WBENCHMSG
MOVE.L 4,A6
SUB.L A1,A1
JSR -294(A6)
MOVE.L D0,A4
TST.L $AC(A4)
BEQ FROM_WB
MOVEM.L (SP)+,D0/A0
BRA RUN
FROM_WB:LEA $5C(A4),A0
JSR -384(A6)
LEA $5C(A4),A0
JSR -372(A6)
MOVE.L D0,WBENCHMSG
MOVEM.L (SP)+,D0/A0
RUN: BSR MAIN
MOVE.L D0,-(SP)
TST.L WBENCHMSG
BEQ EXIT
JSR -132(A6)
MOVE.L WBENCHMSG(PC),A1
JSR -378(A6)
EXIT:
MOVE.L (SP)+,D0
RTS
WBENCHMSG: dc.L 1
EVEN
; --- THE REAL CODE ---
MAIN: LEA DOSLIBNAME(PC),A1
MOVEQ #0,D0
MOVE.L 4,A6 ; ABSOLUTE EXEC-BASE
JSR -552(A6) ; OPENLIBRARY
MOVE.L D0,DOSBASE
MOVE.L D0,A6
MOVE.L #1005,D2
MOVE.L #WSTRUCT,D1
JSR -30(A6)
MOVE.L D0,WHANDLE
*********************************
BUILDMENU:
MOVEQ #0,D4
MOVE.L #$7FF00,D5
LEA CLSTEXT(PC),A2
BSR PRINT ; WRITE (CLEAR FRAMES)
LEA CTEXT1(PC),A2
BSR PRINT
MOVE.L DOSBASE,A6
MOVE.L WHANDLE(PC),D1
MOVE.L #BUFFER,D2
MOVE.L #2,D3
JSR -42(A6) ; READ
MOVE.B BUFFER(PC),D5
BCLR #5,D5 ; CHANGE TO UPPERCASE
CMP.B #`X`,D5
BEQ OUTRUN
CMP.B #`L`,D5
BEQ STARTSEARCH2
CMP.B #`H`,D5
BEQ STARTSEARCH
BRA BUILDMENU
********************************************
OUTRUN:
MOVE.L DOSBASE(PC),A6
MOVE.L WHANDLE(PC),D1
JSR -36(A6) ; CLOSEWINDOW
MOVE.L 4,A6
MOVE.L DOSBASE(PC),A1
JSR -414(A6) ; CLOSELIBRARY
RTS
***********************************
STARTSEARCH:
MOVE.L #$C00000,D4
MOVE.L #$C7FF00,D5
STARTSEARCH2:
MOVE.L D4,STARTPOS
MOVE.L D5,ENDPOS
LEA CTEXT2(PC),A2
BSR PRINT
MOVE.L D4,A0
MK2: CMP.B #`M`,(A0)
BNE MK1
CMP.B #`.`,1(A0)
BNE MK1
CMP.B #`K`,2(A0)
BNE MK1
CMP.B #`.`,3(A0)
BNE MK1
MOVE.L A0,D5
BTST #0,D5
BNE MK1
MOVE.L A0,ACTUALPOS
SUB.L #$438,A0
BCLR #0,MK
BRA SONG_FOUND
MK1: ADDQ #1,A0
MOVE.B (A0),$dff180
CMP.L ENDPOS(PC),A0
BNE MK2
*PASS*2***********************
LEA CTEXT5(PC),A2
BSR PRINT
MOVE.L STARTPOS(PC),A0
SK2: CMP.B #`S`,(A0)
BEQ SK3
CMP.B #`s`,(A0)
BNE SK1
SK3: CMP.B #`T`,1(A0)
BEQ SK4
CMP.B #`t`,1(A0)
BNE SK1
SK4: CMP.B #`-`,2(A0)
BNE SK1
MOVE.L A0,D5
BTST #0,D5
BNE SK1
; --- IS IT A SONG ? ---
MOVE.L A0,A1
SUB.L #20,A1
MOVEQ #19,D0
SO2: MOVE.B (A1)+,D1
BEQ SO1
CMP.B #122,D1
BHI SK1
CMP.B #31,D1
BLS SK1
SO1: DBF D0,SO2
MOVE.L A0,ACTUALPOS
SUB.L #20,A0
BSET #0,MK
BRA SONG_FOUND
SK1: ADDQ #1,A0
MOVE.B (A0),$DFF180
MOVE.B #0,$DFF181
CMP.L ENDPOS(PC),A0
BNE SK2
BRA BUILDMENU
************************
SONG_FOUND:
MOVE.L A0,D5
MOVE.L D5,D7
SONG_AGAIN:
MOVE.L D7,D5
BSR C_TO_A
BSR CALCLEN
; --- print adress
LEA CTEXT3(PC),A2
BSR PRINT
LEA CHARBLOCK(PC),A2
BSR PRINT
; --- print name
LEA CTEXT6(PC),A2
BSR PRINT
MOVE.L D7,A2
BSR PRINT
BSR CALCINT
; --- print length
LEA CTEXT7(PC),A2
BSR PRINT
MOVE.L TOTALLEN,D5
BSR C_TO_A
LEA CHARBLOCK+3(PC),A2
BSR PRINT
; --- song length
LEA CTEXT8(PC),A2
BSR PRINT
MOVE.L D7,A0
MOVEQ #0,D5
MOVE.B $3B6(A0),D5
BSR C_TO_A
LEA CHARBLOCK+6(PC),A2
BSR PRINT
; --- number of patterns
LEA CTEXT9(PC),A2
BSR PRINT
MOVE.L HIGHPAT(PC),D5
ADDQ #1,D5
JSR C_TO_A
LEA CHARBLOCK+6(PC),A2
BSR PRINT
BSR COPYINST
LEA CTEXT10(PC),A2
BSR PRINT
* * * * * * * * * * * * * * * * * * * *
MENU_2:
MOVEQ #32,D0
LEA BUFFER(PC),A0
CLEAR: MOVE.B #0,(A0)+
DBF D0,CLEAR
LEA BUFFER(PC),A2
MOVE.L DOSBASE(PC),A6
MOVE.L WHANDLE(PC),D1
MOVE.L A2,D2
MOVEQ #32,D3
JSR -42(A6) ; READ
MOVE.B #0,-1(A2,D0)
BCLR #5,BUFFER
MOVE.B BUFFER(PC),D1
MOVEQ #0,D0
LEA OPTIONS(PC),A0
TNT: ADDQ #1,D0
MOVE.B (A0)+,D2
CMP.B D1,D2
BNE TNT
SUBQ #1,D0
CMP.B #10,D0
BHI NO_OPT
LSL.L #2,D0
LEA OPTIONS2(PC),A1
MOVE.L (A1,D0),A1
JMP (A1)
NO_OPT:
BRA SONG_AGAIN
***********************
COPYMOD:
MOVE.L D7,A0
MOVE.L #$40000,A1
MOVE.L TOTALLEN(PC),D0
CM1: MOVE.B (A0)+,(A1)+
DBF D0,CM1
BRA SONG_AGAIN
***********************
FLIPFILTER:
MOVE.B #0,D0
BTST #1,$BFE001
BNE FF1
ADD.B #1,D0
FF1: AND.B #1,D0
ASL.B #1,D0
AND.B #$FD,$BFE001
OR.B D0,$BFE001
BRA SONG_AGAIN
***********************
FLIPPY:
LEA CTEXT10+92(PC),A0
LEA TERENCE(PC),A1
MOVEQ #22,D0
FL1: MOVE.B (A1)+,(A0)+
DBF D0,FL1
BCHG #0,FLIP
BRA SONG_AGAIN
***********************
CONTI:
BCLR #0,FLIP
BSR CLEARLIST
MOVE.L ACTUALPOS(PC),A0
TST.B MK
BEQ MK1
BRA SK1
***********************
PLAYIT:
MOVE.L D7,A0
MOVE.B $3B6(A0),SONGLEN
MOVE.B $3B7(A0),PLAYERM
MOVE.L A0,MT_DATA
BSR MT_INIT
MOVE.W #$4000,$DFF09A
MOVE.L $6C,OLDIRQ
MOVE.L #NEWIRQ,$6C
MOVE.W #$C000,$DFF09A
BSR MO
MOVE.W #$4000,$DFF09A
MOVE.L OLDIRQ,$6C
MOVE.W #$C000,$DFF09A
BSR MT_END
BRA SONG_AGAIN
***********************
RENAME:
LEA BUFFER+1(PC),A0
MOVE.L D7,A1
MOVEQ #19,D0
RN1: MOVE.B (A0)+,(A1)+
DBF D0,RN1
BRA SONG_AGAIN
***********************
INSTRENAME:
LEA BUFFER+1(PC),A2
BSR CONVERT
SUBQ #1,D0
BMI IR5
MULU #30,D0
MOVE.L D7,A0
ADD.L #20,A0
ADD.L D0,A0
ADDQ #1,A2
MOVEQ #21,D0
IR4: MOVE.B (A2)+,(A0)+
DBF D0,IR4
IR5: BRA SONG_AGAIN
***********************
PLAYINST:
LEA BUFFER+1(PC),A2
BSR CONVERT
MOVE.L D0,D5
LSL.L #2,D0
LEA INSTIS(PC),A0
MOVE.L (A0,D0),D2
BNE PI1
BRA SONG_AGAIN
PI1:
SUBQ #1,D5
MULU #30,D5
MOVE.L D7,A0
ADD.L #42,A0
ADD.L D5,A0
MOVE.W (A0),D0
MOVE.W #400,D3
PI2:
MOVE.W #$000F,$DFF096
MOVE.W D0,$DFF0A4
MOVE.W D0,$DFF0B4
MOVE.W D0,$DFF0C4
MOVE.W D0,$DFF0D4
MOVE.W D3,$DFF0A6
MOVE.W D3,$DFF0B6
MOVE.W D3,$DFF0C6
MOVE.W D3,$DFF0D6
MOVE.W #64,$DFF0A8
MOVE.W #64,$DFF0B8
MOVE.W #64,$DFF0C8
MOVE.W #64,$DFF0D8
MOVE.L D2,$DFF0A0
MOVE.L D2,$DFF0B0
MOVE.L D2,$DFF0C0
MOVE.L D2,$DFF0D0
MOVE.W #$800F,$DFF096
PI3: BTST #6,$BFE001
BEQ PI4
BTST #2,$DFF016
BEQ PI5
BRA PI3
PI4: BTST #2,$DFF016
BEQ PI6
ADD.B #1,SOFT
BNE PI3
ADD.W #1,D3
MOVE.B #0,SOFT
BRA PI2
PI5: BTST #6,$BFE001
BEQ PI6
ADD.B #1,SOFT
BNE PI3
SUB.W #1,D3
MOVE.B #0,SOFT
BRA PI2
PI6: MOVE.W #$000F,$DFF096
BRA SONG_AGAIN
* * * * * * * * * * * *
SAVING:
MOVE.B BUFFER+1(PC),D0
BCLR #5,D0
CMP.B #`M`,D0
BEQ SAVEMOD
CMP.B #`I`,D0
BEQ SAVEINST
CMP.B #`F`,D0
BEQ SAVESELF
BRA SONG_AGAIN
***********************
SAVEMOD:
MOVE.L D7,A0
LEA NAMEMOD(PC),A1
MOVEQ #19,D0
SM1: MOVE.B (A0)+,(A1)+
DBF D0,SM1
MOVE.L DOSBASE(PC),A6
MOVE.L #FILEBUFFER,D1
MOVE.L #1006,D2
JSR -30(A6)
MOVE.L D0,FILEHANDLE
BEQ ERROR
MOVE.L FILEHANDLE(PC),D1
MOVE.L D7,D2
MOVE.L TOTALLEN(PC),D3
JSR -48(A6)
BRA CLOSE_DOWN
******************************
ERROR:
LEA CTEXT11(PC),A2
BSR PRINT
BSR MO
BRA SONG_AGAIN
************************
SAVEINST:
LEA BUFFER+2(PC),A2
BSR CONVERT
MOVE.L D0,D5
LSL.L #2,D0
LEA INSTIS(PC),A0
MOVE.L (A0,D0),D6
BNE SI4
BRA SONG_AGAIN
SI4:
SUBQ #1,D5
MULU #30,D5
MOVE.L D7,A0
ADD.L #20,A0
ADD.L D5,A0
MOVE.L A0,D4
MOVEQ #0,D5
ADD.L #22,A0
MOVE.W (A0),D5
LSL.L #1,D5
MOVE.L DOSBASE(PC),A6
MOVE.L D4,D1
MOVE.L #1006,D2
JSR -30(A6)
MOVE.L D0,FILEHANDLE
BEQ ERROR
MOVE.L FILEHANDLE(PC),D1
MOVE.L D6,D2
MOVE.L D5,D3
JSR -48(A6)
CLOSE_DOWN:
MOVE.L FILEHANDLE(PC),D1
JSR -36(A6)
BRA SONG_AGAIN
************************
SAVESELF:
LEA CTEXT12(PC),A2
BSR PRINT
LEA FILEBUFFER2(PC),A2
MOVE.L DOSBASE(PC),A6
MOVE.L WHANDLE(PC),D1
MOVE.L A2,D2
MOVEQ #49,D3
JSR -42(A6) ; READ
MOVE.B #0,-1(A2,D0)
MOVE.L DOSBASE,A6
MOVE.L #FILEBUFFER2,D1
MOVE.L #1006,D2
JSR -30(A6)
MOVE.L D0,FILEHANDLE
BEQ ERROR
MOVE.L FILEHANDLE(PC),D1
MOVE.L D7,D2
MOVE.L TOTALLEN(PC),D3
JSR -48(A6)
BRA CLOSE_DOWN
********************
NEWIRQ:
MOVEM.L D0-D6/A0-A6,-(SP)
BSR MT_MUSIC
MOVEM.L (SP)+,D0-D6/A0-A6
dc.W $4EF9
OLDIRQ: dc.L 0
********************************
;-S-U-B-R-O-U-T-I-N-E-S-
;*******************************
;
PRINT:
MOVE.L A2,D2
MOVE.L DOSBASE(PC),A6
MOVE.L WHANDLE(PC),D1
MOVEQ #0,D3
ZERO: CMP.B #0,(A2)+
BEQ DOPRINT
ADDQ #1,D3
BRA ZERO
DOPRINT:
JSR -48(A6)
RTS
****************************
CALCLEN:
MOVEQ #0,D0
MOVEQ #0,D1
MOVEQ #0,D2
MOVE.L D7,A0
MOVE.B $3B6(A0),D0
SUBQ #1,D0
BNE CL1
MOVE.B $3B8(A0),D1
BRA CL4
CL1:
ADD.L #$3B8,A0
MOVE.B (A0)+,D1
CL2:
MOVE.B (A0)+,D2
CMP.B D1,D2
BLS CL3
EXG D2,D1
CL3:
DBF D0,CL2
CL4:
MOVEQ #0,D4
MOVE.B D1,D4
MOVE.L D4,HIGHPAT
MOVE.L D7,A0
MOVEQ #0,D0
MOVEQ #0,D1
MOVEQ #0,D2
MOVEQ #31,D3
CL5:
MOVE.W $2A(A0,D0),D1
ADD.L D1,D2
ADD.L #30,D0
DBF D3,CL5
LSL.L #1,D2
MOVE.L D2,INSTLEN
ADDQ #1,D4
LSL.L #5,D4
LSL.L #5,D4
ADD.L INSTLEN,D4
ADD.L #1084,D4
MOVE.L D4,TOTALLEN
RTS
****************************
CALCINT:
MOVEQ #0,D0
MOVE.L D7,D4
ADD.L TOTALLEN(PC),D4
SUB.L INSTLEN(PC),D4
LEA INSTIS+4(PC),A0
MOVE.L D7,A2
ADD.L #42,A2
MOVEQ #30,D6
CC1: MOVE.W (A2),D0
LSL.L #1,D0
BNE CC2
MOVE.L #0,(A0)+
BRA CC3
CC2: MOVE.L D4,(A0)+
ADD.L D0,D4
CC3: ADD.L #30,A2
DBF D6,CC1
RTS
*****************************
C_TO_A:
MOVEM.L D0-D5/A0,-(SP)
LEA CHARBLOCK(PC),A0
MOVEQ #7,D2
CTA1:
MOVE.L D5,D3
ROL.L #4,D3
MOVE.L D3,D5
AND.B #$0F,D3
CMP.B #9,D3
BLE CTA2
ADD.B #55,D3
BRA CTA3
CTA2:
ADD.B #$30,D3
CTA3:
MOVE.B D3,(A0)+
DBF D2,CTA1
MOVEM.L (SP)+,D0-D5/A0
RTS
*******************************
COPYINST:
LEA CTEXT10+67(PC),A1
MOVE.L D7,A0
ADD.L #20,A0
TST.B FLIP
BEQ CI1
ADD.L #450,A0
MOVEQ #15,D3
BRA CI2
CI1: MOVEQ #19,D0
CI0: MOVE.B #`-`,(A1)+
DBF D0,CI0
ADD.L #37,A1
MOVEQ #14,D3
CI2: MOVEQ #19,D6
CI3: MOVE.B (A0)+,D4
CMP.B #32,D4
BHI CI4
BRA CI5
CI4: CMP.B #128,D4
BLS CI6
CI5: MOVE.B #`.`,D4
CI6: MOVE.B D4,(A1)+
DBF D6,CI3
ADDQ #2,A0
ADDQ #5,A1
; LENGTH
MOVEQ #0,D5
MOVE.W (A0)+,D5
LSL.L #1,D5
BSR C_TO_A
LEA CHARBLOCK+3(PC),A2
MOVEQ #4,D6
CI7: MOVE.B (A2)+,(A1)+
DBF D6,CI7
; REPLEN
LEA CHARBLOCK+3(PC),A2
ADDQ #4,A1
ADDQ #2,A0
MOVEQ #0,D5
MOVE.W (A0)+,D5
LSL.L #1,D5
BSR C_TO_A
MOVEQ #4,D6
CI8: MOVE.B (A2)+,(A1)+
DBF D6,CI8
; REPEAT
LEA CHARBLOCK+3(PC),A2
ADDQ #4,A1
MOVEQ #0,D5
MOVE.W (A0)+,D5
LSL.L #1,D5
BSR C_TO_A
MOVEQ #4,D6
CI9: MOVE.B (A2)+,(A1)+
DBF D6,CI9
ADD.L #9,A1
DBF D3,CI2
RTS
*******************************
CLEARLIST:
LEA CTEXT10+67(PC),A0
MOVEQ #15,D1
CRL2: MOVEQ #19,D0
CRL1: MOVE.B #`.`,(A0)+
DBF D0,CRL1
ADD.L #37,A0
DBF D1,CRL2
RTS
********************************
CONVERT:
MOVEQ #0,D0
MOVE.B (A2),D0
CMP.B #`9`,D0
BLS CO1
BCLR #5,D0
SUB.B #39,D0
TST.B FLIP
BNE CO0
SUB.B #16,D0
CO0: BRA CO2
CO1: SUB.B #32,D0
TST.B FLIP
BNE CO2
SUB.B #16,D0
CO2: RTS
;-----------------------------
MO: BTST #6,$BFE001
BNE MO
RTS
;
; NOISETRACKERV1.0 REPLAYROUTINE
; MAHONEY & KAKTUS - HALLONSOFT 1989
;
MT_INIT:MOVE.L MT_DATA(PC),A0
MOVE.L A0,A1
ADD.L #$3B8,A1
MOVEQ #$7F,D0
MOVEQ #0,D1
MT_LOOP:MOVE.L D1,D2
SUBQ.W #1,D0
MT_LOP2:MOVE.B (A1)+,D1
CMP.B D2,D1
BGT.S MT_LOOP
DBF D0,MT_LOP2
ADDQ.B #1,D2
LEA MT_SAMPLESTARTS(PC),A1
ASL.L #8,D2
ASL.L #2,D2
ADD.L #$43C,D2
ADD.L A0,D2
MOVE.L D2,A2
MOVEQ #$1E,D0
MT_LOP3:CLR.L (A2)
MOVE.L A2,(A1)+
MOVEQ #0,D1
MOVE.W 42(A0),D1
ASL.L #1,D1
ADD.L D1,A2
ADD.L #$1E,A0
DBF D0,MT_LOP3
MOVE.B #$6,MT_SPEED
CLR.W $DFF0A8
CLR.W $DFF0B8
CLR.W $DFF0C8
CLR.W $DFF0D8
CLR.B MT_SONGPOS
CLR.B MT_COUNTER
CLR.W MT_PATTPOS
RTS
MT_END: CLR.W $DFF0A8
CLR.W $DFF0B8
CLR.W $DFF0C8
CLR.W $DFF0D8
MOVE.W #$F,$DFF096
RTS
MT_MUSIC:
MOVEM.L D0-D4/A0-A3/A5-A6,-(A7)
MOVE.L MT_DATA,A0
ADDQ.B #$1,MT_COUNTER
MOVE.B MT_COUNTER(PC),D0
CMP.B MT_SPEED(PC),D0
BLT.S MT_NONEW
CLR.B MT_COUNTER
BRA MT_GETNEW
MT_NONEW:
LEA MT_VOICE1(PC),A6
LEA $DFF0A0,A5
BSR MT_CHECKCOM
LEA MT_VOICE2(PC),A6
LEA $DFF0B0,A5
BSR MT_CHECKCOM
LEA MT_VOICE3(PC),A6
LEA $DFF0C0,A5
BSR MT_CHECKCOM
LEA MT_VOICE4(PC),A6
LEA $DFF0D0,A5
BSR MT_CHECKCOM
BRA MT_ENDR
MT_ARPEGGIO:
MOVEQ #0,D0
MOVE.B MT_COUNTER(PC),D0
DIVS #$3,D0
SWAP D0
CMP.W #$0,D0
BEQ.S MT_ARP2
CMP.W #$2,D0
BEQ.S MT_ARP1
MOVEQ #0,D0
MOVE.B $3(A6),D0
LSR.B #4,D0
BRA.S MT_ARP3
MT_ARP1:MOVEQ #0,D0
MOVE.B $3(A6),D0
AND.B #$F,D0
BRA.S MT_ARP3
MT_ARP2:MOVE.W $10(A6),D2
BRA.S MT_ARP4
MT_ARP3:ASL.W #1,D0
MOVEQ #0,D1
MOVE.W $10(A6),D1
LEA MT_PERIODS(PC),A0
MOVEQ #$24,D7
MT_ARPLOOP:
MOVE.W (A0,D0.W),D2
CMP.W (A0),D1
BGE.S MT_ARP4
ADDQ.L #2,A0
DBF D7,MT_ARPLOOP
RTS
MT_ARP4:MOVE.W D2,$6(A5)
RTS
MT_GETNEW:
MOVE.L MT_DATA(PC),A0
MOVE.L A0,A3
MOVE.L A0,A2
ADD.L #$C,A3
ADD.L #$3B8,A2
ADD.L #$43C,A0
MOVEQ #0,D0
MOVE.L D0,D1
MOVE.B MT_SONGPOS(PC),D0
MOVE.B (A2,D0.W),D1
ASL.L #8,D1
ASL.L #2,D1
ADD.W MT_PATTPOS,D1
CLR.W MT_DMACON
LEA $DFF0A0,A5
LEA MT_VOICE1(PC),A6
BSR.S MT_PLAYVOICE
LEA $DFF0B0,A5
LEA MT_VOICE2(PC),A6
BSR.S MT_PLAYVOICE
LEA $DFF0C0,A5
LEA MT_VOICE3(PC),A6
BSR.S MT_PLAYVOICE
LEA $DFF0D0,A5
LEA MT_VOICE4(PC),A6
BSR.S MT_PLAYVOICE
BRA MT_SETDMA
MT_PLAYVOICE:
MOVE.L (A0,D1.L),(A6)
ADDQ.L #4,D1
MOVEQ #0,D2
MOVE.B $2(A6),D2
AND.B #$F0,D2
LSR.B #4,D2
MOVE.B (A6),D0
AND.B #$F0,D0
OR.B D0,D2
TST.B D2
BEQ.S MT_SETREGS
MOVEQ #0,D3
LEA MT_SAMPLESTARTS(PC),A1
MOVE.L D2,D4
SUBQ.L #$1,D2
ASL.L #2,D2
MULU #$1E,D4
MOVE.L (A1,D2.L),$4(A6)
MOVE.W (A3,D4.L),$8(A6)
MOVE.W $2(A3,D4.L),$12(A6)
MOVE.W $4(A3,D4.L),D3
TST.W D3
BEQ.S MT_NOLOOP
MOVE.L $4(A6),D2
ASL.W #1,D3
ADD.L D3,D2
MOVE.L D2,$A(A6)
MOVE.W $4(A3,D4.L),D0
ADD.W $6(A3,D4.L),D0
MOVE.W D0,8(A6)
MOVE.W $6(A3,D4.L),$E(A6)
MOVE.W $12(A6),$8(A5)
BRA.S MT_SETREGS
MT_NOLOOP:
MOVE.L $4(A6),D2
ADD.L D3,D2
MOVE.L D2,$A(A6)
MOVE.W $6(A3,D4.L),$E(A6)
MOVE.W $12(A6),$8(A5)
MT_SETREGS:
MOVE.W (A6),D0
AND.W #$FFF,D0
BEQ MT_CHECKCOM2
MOVE.B $2(A6),D0
AND.B #$F,D0
CMP.B #$3,D0
BNE.S MT_SETPERIOD
BSR MT_SETMYPORT
BRA MT_CHECKCOM2
MT_SETPERIOD:
MOVE.W (A6),$10(A6)
AND.W #$FFF,$10(A6)
MOVE.W $14(A6),D0
MOVE.W D0,$DFF096
CLR.B $1B(A6)
MOVE.L $4(A6),(A5)
MOVE.W $8(A6),$4(A5)
MOVE.W $10(A6),D0
AND.W #$FFF,D0
MOVE.W D0,$6(A5)
MOVE.W $14(A6),D0
OR.W D0,MT_DMACON
BRA MT_CHECKCOM2
MT_SETDMA:
MOVE.W #$12C,D0
MT_WAIT:DBF D0,MT_WAIT
MOVE.W MT_DMACON(PC),D0
OR.W #$8000,D0
MOVE.W D0,$DFF096
MOVE.W #$12C,D0
MT_WAI2:DBF D0,MT_WAI2
LEA $DFF000,A5
LEA MT_VOICE4(PC),A6
MOVE.L $A(A6),$D0(A5)
MOVE.W $E(A6),$D4(A5)
LEA MT_VOICE3(PC),A6
MOVE.L $A(A6),$C0(A5)
MOVE.W $E(A6),$C4(A5)
LEA MT_VOICE2(PC),A6
MOVE.L $A(A6),$B0(A5)
MOVE.W $E(A6),$B4(A5)
LEA MT_VOICE1(PC),A6
MOVE.L $A(A6),$A0(A5)
MOVE.W $E(A6),$A4(A5)
ADD.W #$10,MT_PATTPOS
CMP.W #$400,MT_PATTPOS
BNE.S MT_ENDR
MT_NEX: CLR.W MT_PATTPOS
CLR.B MT_BREAK
ADDQ.B #1,MT_SONGPOS
AND.B #$7F,MT_SONGPOS
MOVE.B MT_SONGPOS(PC),D1
CMP.B SONGLEN(PC),D1
BNE.S MT_ENDR
MOVE.B PLAYERM(PC),MT_SONGPOS
MT_ENDR:TST.B MT_BREAK
BNE.S MT_NEX
MOVEM.L (A7)+,D0-D4/A0-A3/A5-A6
RTS
MT_SETMYPORT:
MOVE.W (A6),D2
AND.W #$FFF,D2
MOVE.W D2,$18(A6)
MOVE.W $10(A6),D0
CLR.B $16(A6)
CMP.W D0,D2
BEQ.S MT_CLRPORT
BGE.S MT_RT
MOVE.B #$1,$16(A6)
RTS
MT_CLRPORT:
CLR.W $18(A6)
MT_RT: RTS
MT_MYPORT:
MOVE.B $3(A6),D0
BEQ.S MT_MYSLIDE
MOVE.B D0,$17(A6)
CLR.B $3(A6)
MT_MYSLIDE:
TST.W $18(A6)
BEQ.S MT_RT
MOVEQ #0,D0
MOVE.B $17(A6),D0
TST.B $16(A6)
BNE.S MT_MYSUB
ADD.W D0,$10(A6)
MOVE.W $18(A6),D0
CMP.W $10(A6),D0
BGT.S MT_MYOK
MOVE.W $18(A6),$10(A6)
CLR.W $18(A6)
MT_MYOK:MOVE.W $10(A6),$6(A5)
RTS
MT_MYSUB:
SUB.W D0,$10(A6)
MOVE.W $18(A6),D0
CMP.W $10(A6),D0
BLT.S MT_MYOK
MOVE.W $18(A6),$10(A6)
CLR.W $18(A6)
MOVE.W $10(A6),$6(A5)
RTS
MT_VIB: MOVE.B $3(A6),D0
BEQ.S MT_VI
MOVE.B D0,$1A(A6)
MT_VI: MOVE.B $1B(A6),D0
LEA MT_SIN(PC),A4
LSR.W #$2,D0
AND.W #$1F,D0
MOVEQ #0,D2
MOVE.B (A4,D0.W),D2
MOVE.B $1A(A6),D0
AND.W #$F,D0
MULU D0,D2
LSR.W #$6,D2
MOVE.W $10(A6),D0
TST.B $1B(A6)
BMI.S MT_VIBMIN
ADD.W D2,D0
BRA.S MT_VIB2
MT_VIBMIN:
SUB.W D2,D0
MT_VIB2:MOVE.W D0,$6(A5)
MOVE.B $1A(A6),D0
LSR.W #$2,D0
AND.W #$3C,D0
ADD.B D0,$1B(A6)
RTS
MT_NOP: MOVE.W $10(A6),$6(A5)
RTS
MT_CHECKCOM:
MOVE.W $2(A6),D0
AND.W #$FFF,D0
BEQ.S MT_NOP
MOVE.B $2(A6),D0
AND.B #$F,D0
TST.B D0
BEQ MT_ARPEGGIO
CMP.B #$1,D0
BEQ.S MT_PORTUP
CMP.B #$2,D0
BEQ MT_PORTDOWN
CMP.B #$3,D0
BEQ MT_MYPORT
CMP.B #$4,D0
BEQ MT_VIB
MOVE.W $10(A6),$6(A5)
CMP.B #$A,D0
BEQ.S MT_VOLSLIDE
RTS
MT_VOLSLIDE:
MOVEQ #0,D0
MOVE.B $3(A6),D0
LSR.B #4,D0
TST.B D0
BEQ.S MT_VOLDOWN
ADD.W D0,$12(A6)
CMP.W #$40,$12(A6)
BMI.S MT_VOL2
MOVE.W #$40,$12(A6)
MT_VOL2:MOVE.W $12(A6),$8(A5)
RTS
MT_VOLDOWN:
MOVEQ #0,D0
MOVE.B $3(A6),D0
AND.B #$F,D0
SUB.W D0,$12(A6)
BPL.S MT_VOL3
CLR.W $12(A6)
MT_VOL3:MOVE.W $12(A6),$8(A5)
RTS
MT_PORTUP:
MOVEQ #0,D0
MOVE.B $3(A6),D0
SUB.W D0,$10(A6)
MOVE.W $10(A6),D0
AND.W #$FFF,D0
CMP.W #$71,D0
BPL.S MT_POR2
AND.W #$F000,$10(A6)
OR.W #$71,$10(A6)
MT_POR2:MOVE.W $10(A6),D0
AND.W #$FFF,D0
MOVE.W D0,$6(A5)
RTS
MT_PORTDOWN:
CLR.W D0
MOVE.B $3(A6),D0
ADD.W D0,$10(A6)
MOVE.W $10(A6),D0
AND.W #$FFF,D0
CMP.W #$358,D0
BMI.S MT_POR3
AND.W #$F000,$10(A6)
OR.W #$358,$10(A6)
MT_POR3:MOVE.W $10(A6),D0
AND.W #$FFF,D0
MOVE.W D0,$6(A5)
RTS
MT_CHECKCOM2:
MOVE.B $2(A6),D0
AND.B #$F,D0
CMP.B #$D,D0
BEQ.S MT_PATTBREAK
CMP.B #$B,D0
BEQ.S MT_POSJMP
CMP.B #$C,D0
BEQ.S MT_SETVOL
CMP.B #$F,D0
BEQ.S MT_SETSPEED
RTS
MT_PATTBREAK:
NOT.B MT_BREAK
RTS
MT_POSJMP:
MOVE.B $3(A6),D0
SUBQ.B #$1,D0
MOVE.B D0,MT_SONGPOS
NOT.B MT_BREAK
RTS
MT_SETVOL:
CMP.B #$40,$3(A6)
BLE.S MT_VOL4
MOVE.B #$40,$3(A6)
MT_VOL4:MOVE.B $3(A6),$8(A5)
RTS
MT_SETSPEED:
CMP.B #$1F,$3(A6)
BLE.S MT_SETS
MOVE.B #$1F,$3(A6)
MT_SETS:MOVE.B $3(A6),D0
BEQ.S MT_RTS2
MOVE.B D0,MT_SPEED
CLR.B MT_COUNTER
MT_RTS2:RTS
MT_SIN:
dc.B $00,$18,$31,$4A,$61,$78,$8D,$A1,$B4,$C5,$D4,$E0,$EB,$F4,$FA,$FD
dc.B $FF,$FD,$FA,$F4,$EB,$E0,$D4,$C5,$B4,$A1,$8D,$78,$61,$4A,$31,$18
MT_PERIODS:
dc.W $0358,$0328,$02FA,$02D0,$02A6,$0280,$025C,$023A,$021A,$01FC,$01E0
dc.W $01C5,$01AC,$0194,$017D,$0168,$0153,$0140,$012E,$011D,$010D,$00FE
dc.W $00F0,$00E2,$00D6,$00CA,$00BE,$00B4,$00AA,$00A0,$0097,$008F,$0087
dc.W $007F,$0078,$0071,$0000,$0000
MT_SPEED: dc.B $6
MT_SONGPOS: dc.B $0
MT_PATTPOS: dc.W $0
MT_COUNTER: dc.B $0
MT_BREAK: dc.B $0
MT_DMACON: dc.W $0
MT_SAMPLESTARTS:BLK.L $1F,0
MT_VOICE1: BLK.W 10,0
dc.W $1
BLK.W 3,0
MT_VOICE2: BLK.W 10,0
dc.W $2
BLK.W 3,0
MT_VOICE3: BLK.W 10,0
dc.W $4
BLK.W 3,0
MT_VOICE4: BLK.W 10,0
dc.W $8
BLK.W 3,0
even
doslibname: dc.b "dos.library",0
even
DOSBASE: dc.L 0
************************
CHARBLOCK:BLK.B 9,0
************************
FLIP: dc.B 0
MK: dc.B 0
SOFT: dc.B 0
SONGLEN: dc.B 0
PLAYERM: dc.B 0
OPTIONS: dc.B "XCFPNRISWO"
even
MODLEN: dc.l 0
HIGHPAT: dc.l 0
INSTLEN: dc.l 0
TOTALLEN: dc.L 0
MT_DATA: dc.l 0
FILEHANDLE: dc.L 0
OPTIONS2: dc.L BUILDMENU,CONTI,FLIPPY,PLAYIT,RENAME
dc.L INSTRENAME,PLAYINST,SAVING,FLIPFILTER,COPYMOD
************************
whandle: dc.l 0
wstruct: dc.b "CON:0/0/640/250/"
dc.b " >>> NOISERIPPER V1.15 BY ALLEYCAT <<<"
dc.b " ",0
************************
EVEN
buffer:blk.b 40,0
FILEBUFFER: dc.B "DF0:MODULES/"
NAMEMOD:BLK.B 25,0
FILEBUFFER2:BLK.B 50,0
EVEN
ACTUALPOS: dc.L 0
ENDPOS: dc.L 0
STARTPOS: dc.L 0
************************
CLSText:
dc.b $1b,$63,$1b,$5b,$30,$78,$1b,$5b,$36,$34,$34,$75
dc.b $1b,$5b,$31,$30,$79,$1b,$5b,$33,$33,$74
dc.b $0c,$0c,$0a
dc.b " ",$0A,$0A,$0A
dc.b " L - Start Searching (Chipmem)",$0a,$0a
dc.b " H - Start Searching (Fastmem)",$0a,$0a
dc.b " X - Quit this Program",$0a,$0a
dc.B 10,10,10,10,10,10,"Read the DOCS for more information!"
dc.b $9b,$20,$70
dc.b 0
************************
CText1: dc.b $9b,"13",$48
dc.B "Your Command ->",0
************************
CText2: dc.b $0c,$0a,$0a
dc.B "SEARCHING...PASS 1",$9B,$30,$20,$70,0
************************
CText3: dc.b $0c
dc.b "SONG ADRESS : $",0
************************
CText5: dc.b $0C,$0a,$0a
dc.B "SEARCHING...PASS2",$9B,$30,$20,$70,0
************************
CText6: dc.B " SONGNAME : ",0
************************
CText7: dc.B $9B,"0",$3B,"57",$48
dc.B " MOD-LENGTH : $",0
************************
CText8: dc.B $0A
dc.B "SONG-LENGTH : $",0
************************
CText9: dc.B " # OF PATTERNS : $",0
************************
TERENCE:
dc.B "00000 $00000 $00000"
************************
CText10: dc.B $0A,$0A
dc.B "INST# INSTRUMENT NAME LENGTH REPEAT REPLEN",$0A
dc.B " 0 .................... $00000 $00000 $00000",$0A
dc.B " 1 .................... $00000 $00000 $00000",$0A
dc.B " 2 .................... $00000 $00000 $00000",$0A
dc.B " 3 .................... $00000 $00000 $00000",$0A
dc.B " 4 .................... $00000 $00000 $00000",$0A
dc.B " 5 .................... $00000 $00000 $00000",$0A
dc.B " 6 .................... $00000 $00000 $00000",$0A
dc.B " 7 .................... $00000 $00000 $00000",$0A
dc.B " 8 .................... $00000 $00000 $00000",$0A
dc.B " 9 .................... $00000 $00000 $00000",$0A
dc.B " A .................... $00000 $00000 $00000",$0A
dc.B " B .................... $00000 $00000 $00000",$0A
dc.B " C .................... $00000 $00000 $00000",$0A
dc.B " D .................... $00000 $00000 $00000",$0A
dc.B " E .................... $00000 $00000 $00000",$0A
dc.B " F .................... $00000 $00000 $00000",$0A
dc.b $0a
dc.B "F - FLIP INSTRUMENT PAGES C - CONTINUE SEARCH",$0A
dc.B "X - RETURN TO MAIN MENU P - PLAY SONG",$0A
dc.B "N(name) - RENAME SONG R(#)(name) - RENAME INSTRUMENT"
dc.B $0A
dc.B "I(#) - PLAY INSTRUMENT SI(#) - SAVE INSTRUMENT",$0A
dc.B "SM - SAVE MODULE (AUTO) SF - SAVE MODULE (SELF)"
dc.B 10
dc.B "W - FLIP FILTER O - COPY MODULE TO $40000"
dc.B $9B,$20,$70
dc.B $0A,$0A,"YOUR COMMAND ->",0
CTEXT11:
dc.B $9B,"30",$48
dc.B "*** ERROR OCCURED ! PLEASE CHECK DISK *** (MOUSE)",0
CTEXT12:
dc.B $9B,"29",$48
dc.B "ENTER THE FILENAME (WITH PATH) ->",0
EVEN
INSTIS:BLK.L 32,0